home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source text
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 0a | 50 61 74 68 3a 20 69 6e |.lang.c.|Path: in|
|00000020| 32 2e 75 75 2e 6e 65 74 | 21 62 63 73 74 65 63 21 |2.uu.net|!bcstec!|
|00000030| 6e 6e 74 70 0a 46 72 6f | 6d 3a 20 4b 65 76 69 6e |nntp.Fro|m: Kevin|
|00000040| 20 49 6e 67 61 6c 6c 73 | 20 3c 69 6e 67 6b 6c 39 | Ingalls| <ingkl9|
|00000050| 30 30 40 63 63 6d 61 69 | 6c 2e 63 61 2e 62 6f 65 |00@ccmai|l.ca.boe|
|00000060| 69 6e 67 2e 63 6f 6d 3e | 0a 53 75 62 6a 65 63 74 |ing.com>|.Subject|
|00000070| 3a 20 52 65 3a 20 53 69 | 6d 70 6c 65 20 43 20 70 |: Re: Si|mple C p|
|00000080| 72 6f 67 72 61 6d 20 74 | 6f 20 6c 69 73 74 20 63 |rogram t|o list c|
|00000090| 6f 6e 74 65 6e 74 73 20 | 6f 66 20 61 20 66 69 6c |ontents |of a fil|
|000000a0| 65 20 2d 20 68 65 6c 70 | 21 0a 58 2d 4e 6e 74 70 |e - help|!.X-Nntp|
|000000b0| 2d 50 6f 73 74 69 6e 67 | 2d 48 6f 73 74 3a 20 31 |-Posting|-Host: 1|
|000000c0| 33 37 2e 31 33 36 2e 31 | 36 2e 31 34 39 0a 43 6f |37.136.1|6.149.Co|
|000000d0| 6e 74 65 6e 74 2d 54 79 | 70 65 3a 20 74 65 78 74 |ntent-Ty|pe: text|
|000000e0| 2f 70 6c 61 69 6e 3b 20 | 63 68 61 72 73 65 74 3d |/plain; |charset=|
|000000f0| 75 73 2d 61 73 63 69 69 | 0a 4d 65 73 73 61 67 65 |us-ascii|.Message|
|00000100| 2d 49 44 3a 20 3c 44 4d | 30 38 30 4a 2e 47 31 32 |-ID: <DM|080J.G12|
|00000110| 40 62 63 73 74 65 63 2e | 63 61 2e 62 6f 65 69 6e |@bcstec.|ca.boein|
|00000120| 67 2e 63 6f 6d 3e 0a 54 | 6f 3a 20 67 6f 6d 70 61 |g.com>.T|o: gompa|
|00000130| 40 6e 69 63 6b 65 6c 2e | 75 63 73 2e 69 6e 64 69 |@nickel.|ucs.indi|
|00000140| 61 6e 61 2e 65 64 75 0a | 53 65 6e 64 65 72 3a 20 |ana.edu.|Sender: |
|00000150| 6e 6e 74 70 40 62 63 73 | 74 65 63 2e 63 61 2e 62 |nntp@bcs|tec.ca.b|
|00000160| 6f 65 69 6e 67 2e 63 6f | 6d 20 28 4e 4e 54 50 20 |oeing.co|m (NNTP |
|00000170| 4e 65 77 73 20 41 63 63 | 65 73 73 29 0a 43 6f 6e |News Acc|ess).Con|
|00000180| 74 65 6e 74 2d 54 72 61 | 6e 73 66 65 72 2d 45 6e |tent-Tra|nsfer-En|
|00000190| 63 6f 64 69 6e 67 3a 20 | 37 62 69 74 0a 4f 72 67 |coding: |7bit.Org|
|000001a0| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 42 6f 65 69 6e |anizatio|n: Boein|
|000001b0| 67 20 44 65 66 65 6e 73 | 65 20 26 20 53 70 61 63 |g Defens|e & Spac|
|000001c0| 65 20 47 72 6f 75 70 20 | 54 72 61 69 6e 69 6e 67 |e Group |Training|
|000001d0| 0a 52 65 66 65 72 65 6e | 63 65 73 3a 20 3c 34 65 |.Referen|ces: <4e|
|000001e0| 67 6b 73 38 24 6e 6c 75 | 40 75 73 65 6e 65 74 2e |gks8$nlu|@usenet.|
|000001f0| 75 63 73 2e 69 6e 64 69 | 61 6e 61 2e 65 64 75 3e |ucs.indi|ana.edu>|
|00000200| 0a 4d 69 6d 65 2d 56 65 | 72 73 69 6f 6e 3a 20 31 |.Mime-Ve|rsion: 1|
|00000210| 2e 30 0a 44 61 74 65 3a | 20 54 75 65 2c 20 33 30 |.0.Date:| Tue, 30|
|00000220| 20 4a 61 6e 20 31 39 39 | 36 20 31 37 3a 31 37 3a | Jan 199|6 17:17:|
|00000230| 30 36 20 47 4d 54 0a 58 | 2d 4d 61 69 6c 65 72 3a |06 GMT.X|-Mailer:|
|00000240| 20 4d 6f 7a 69 6c 6c 61 | 20 31 2e 31 4e 20 28 4d | Mozilla| 1.1N (M|
|00000250| 61 63 69 6e 74 6f 73 68 | 3b 20 49 3b 20 50 50 43 |acintosh|; I; PPC|
|00000260| 29 0a 58 2d 55 72 6c 3a | 20 6e 65 77 73 3a 34 65 |).X-Url:| news:4e|
|00000270| 67 6b 73 38 24 6e 6c 75 | 40 75 73 65 6e 65 74 2e |gks8$nlu|@usenet.|
|00000280| 75 63 73 2e 69 6e 64 69 | 61 6e 61 2e 65 64 75 0a |ucs.indi|ana.edu.|
|00000290| 0a 67 6f 6d 70 61 40 6e | 69 63 6b 65 6c 2e 75 63 |.gompa@n|ickel.uc|
|000002a0| 73 2e 69 6e 64 69 61 6e | 61 2e 65 64 75 20 28 52 |s.indian|a.edu (R|
|000002b0| 61 67 68 75 20 52 2e 20 | 47 6f 6d 70 61 29 20 77 |aghu R. |Gompa) w|
|000002c0| 72 6f 74 65 3a 0a 3e 0a | 3e 49 20 61 6d 20 74 72 |rote:.>.|>I am tr|
|000002d0| 79 69 6e 67 20 74 6f 20 | 66 69 67 75 72 65 20 6f |ying to |figure o|
|000002e0| 75 74 20 77 68 61 74 20 | 69 73 20 77 72 6f 6e 67 |ut what |is wrong|
|000002f0| 20 77 69 74 68 20 74 68 | 69 73 0a 3e 70 72 6f 67 | with th|is.>prog|
|00000300| 72 61 6d 2e 20 20 54 68 | 65 20 66 6f 6c 6c 6f 77 |ram. Th|e follow|
|00000310| 69 6e 67 20 69 73 20 77 | 72 69 74 74 65 6e 20 66 |ing is w|ritten f|
|00000320| 6f 72 20 64 6f 73 20 65 | 6e 76 69 72 6f 6e 6d 65 |or dos e|nvironme|
|00000330| 6e 74 3a 0a 3e 22 74 79 | 70 65 6d 65 2e 63 22 0a |nt:.>"ty|peme.c".|
|00000340| 3e 0a 3e 49 74 20 69 73 | 20 73 75 70 70 6f 73 65 |>.>It is| suppose|
|00000350| 64 20 74 6f 20 67 65 74 | 20 77 6f 72 64 73 20 66 |d to get| words f|
|00000360| 72 6f 6d 20 66 69 6c 65 | 20 61 6e 64 20 6c 69 73 |rom file| and lis|
|00000370| 74 20 74 68 65 6d 20 77 | 69 74 68 0a 3e 61 72 67 |t them w|ith.>arg|
|00000380| 75 6d 65 6e 74 73 20 6c | 69 6b 65 20 68 65 6c 70 |uments l|ike help|
|00000390| 20 6d 65 20 70 6c 65 61 | 73 65 20 77 69 74 68 20 | me plea|se with |
|000003a0| 74 68 65 20 63 6f 6d 6d | 61 6e 64 3a 0a 3e 20 20 |the comm|and:.> |
|000003b0| 20 20 20 74 79 70 65 6d | 65 20 2d 66 20 66 69 6c | typem|e -f fil|
|000003c0| 65 20 68 65 6c 70 20 6d | 65 20 70 6c 65 61 73 65 |e help m|e please|
|000003d0| 0a 3e 0a 3e 44 65 70 65 | 6e 64 69 6e 67 20 6f 6e |.>.>Depe|nding on|
|000003e0| 20 74 68 65 20 6e 75 6d | 62 65 72 20 6f 66 20 61 | the num|ber of a|
|000003f0| 72 67 75 6d 65 6e 74 73 | 2c 20 49 20 73 6f 6d 65 |rguments|, I some|
|00000400| 74 69 6d 65 73 20 67 65 | 74 74 69 6e 67 0a 3e 73 |times ge|tting.>s|
|00000410| 74 72 61 6e 67 65 20 65 | 72 72 6f 72 20 6d 65 73 |trange e|rror mes|
|00000420| 73 61 67 65 73 20 2d 20 | 73 79 73 74 65 6d 20 73 |sages - |system s|
|00000430| 74 75 63 6b 20 73 6f 6d | 65 20 74 69 6d 65 73 2e |tuck som|e times.|
|00000440| 0a 3e 50 6c 65 61 73 65 | 20 68 65 6c 70 2e 20 20 |.>Please| help. |
|00000450| 54 68 69 73 20 69 73 20 | 70 61 72 74 20 6f 66 20 |This is |part of |
|00000460| 61 20 70 72 6f 6a 65 63 | 74 20 28 6e 6f 74 20 61 |a projec|t (not a|
|00000470| 20 68 6f 6d 65 77 6f 72 | 6b 29 0a 3e 49 20 61 6d | homewor|k).>I am|
|00000480| 20 74 72 79 69 6e 67 20 | 74 6f 20 63 6f 6d 70 6c | trying |to compl|
|00000490| 65 74 65 2e 20 2e 2e 20 | 54 68 61 6e 6b 73 20 69 |ete. .. |Thanks i|
|000004a0| 6e 20 61 64 76 61 6e 63 | 65 2e 20 2e 2e 20 52 61 |n advanc|e. .. Ra|
|000004b0| 67 68 75 0a 3e 0a 3e 0a | 5b 63 6f 64 65 20 72 65 |ghu.>.>.|[code re|
|000004c0| 6d 6f 76 65 64 2c 20 76 | 65 72 73 69 6f 6e 20 77 |moved, v|ersion w|
|000004d0| 69 74 68 20 6d 79 20 61 | 64 6a 75 73 74 6d 65 6e |ith my a|djustmen|
|000004e0| 74 73 20 66 6f 6c 6c 6f | 77 73 20 2e 2e 2e 5d 0a |ts follo|ws ...].|
|000004f0| 0a 54 68 65 72 65 20 61 | 72 65 20 61 20 63 6f 75 |.There a|re a cou|
|00000500| 70 6c 65 20 6f 66 20 6d | 69 6e 6f 72 20 70 72 6f |ple of m|inor pro|
|00000510| 62 6c 65 6d 73 20 77 69 | 74 68 20 74 68 65 20 63 |blems wi|th the c|
|00000520| 6f 64 65 20 74 68 61 74 | 20 77 6f 75 6c 64 20 63 |ode that| would c|
|00000530| 61 75 73 65 0a 69 74 20 | 62 65 20 62 65 68 61 76 |ause.it |be behav|
|00000540| 65 20 28 6f 72 20 6d 69 | 73 62 65 68 61 76 65 20 |e (or mi|sbehave |
|00000550| 3a 29 20 29 20 73 74 72 | 61 6e 67 65 6c 79 2e 0a |:) ) str|angely..|
|00000560| 0a 3e 63 68 61 72 20 66 | 69 72 73 74 5b 31 30 30 |.>char f|irst[100|
|00000570| 5d 2c 20 6c 65 74 74 2c | 20 2a 77 6f 72 64 73 5b |], lett,| *words[|
|00000580| 31 30 30 5d 2c 20 66 69 | 6c 65 6e 61 6d 65 5b 31 |100], fi|lename[1|
|00000590| 35 5d 3b 0a 5b 73 6f 6d | 65 20 73 74 75 66 66 20 |5];.[som|e stuff |
|000005a0| 2e 2e 2e 20 5d 0a 3e 20 | 20 20 20 6b 3d 30 3b 2a |... ].> | k=0;*|
|000005b0| 77 6f 72 64 73 5b 31 5d | 3d 27 31 27 3b 0a 0a 54 |words[1]|='1';..T|
|000005c0| 68 65 20 70 72 6f 62 6c | 65 6d 20 77 69 74 68 20 |he probl|em with |
|000005d0| 74 68 65 20 61 62 6f 76 | 65 20 64 65 63 6c 61 72 |the abov|e declar|
|000005e0| 61 74 69 6f 6e 20 61 6e | 64 20 75 73 65 20 6f 66 |ation an|d use of|
|000005f0| 20 27 77 6f 72 64 73 27 | 20 69 74 20 74 68 61 74 | 'words'| it that|
|00000600| 0a 74 68 65 72 65 20 69 | 73 20 6e 6f 20 63 68 61 |.there i|s no cha|
|00000610| 72 20 73 70 61 63 65 20 | 74 6f 20 61 73 73 69 67 |r space |to assig|
|00000620| 6e 20 61 6e 79 74 68 69 | 6e 67 20 74 6f 20 2a 77 |n anythi|ng to *w|
|00000630| 6f 72 64 73 5b 31 5d 20 | 6f 72 20 61 6e 79 20 6f |ords[1] |or any o|
|00000640| 66 0a 74 68 65 20 6f 74 | 68 65 72 20 70 6f 69 6e |f.the ot|her poin|
|00000650| 74 65 72 73 20 69 6e 20 | 27 77 6f 72 64 73 27 2e |ters in |'words'.|
|00000660| 20 27 77 6f 72 64 73 27 | 20 69 73 20 61 6e 20 61 | 'words'| is an a|
|00000670| 72 72 61 79 20 6f 66 20 | 63 68 61 72 20 70 6f 69 |rray of |char poi|
|00000680| 6e 74 65 72 73 2c 0a 62 | 75 74 20 74 68 65 20 63 |nters,.b|ut the c|
|00000690| 68 61 72 61 63 74 65 72 | 20 70 6f 69 6e 74 65 72 |haracter| pointer|
|000006a0| 73 20 28 61 6c 6c 20 31 | 30 30 20 6f 66 20 74 68 |s (all 1|00 of th|
|000006b0| 65 6d 29 20 64 6f 20 6e | 6f 74 20 70 6f 69 6e 74 |em) do n|ot point|
|000006c0| 20 74 6f 20 61 6e 79 74 | 68 69 6e 67 20 0a 69 6e | to anyt|hing .in|
|000006d0| 20 70 61 72 74 69 63 75 | 6c 61 72 2e 20 41 63 63 | particu|lar. Acc|
|000006e0| 65 73 73 69 6e 67 20 74 | 68 65 73 65 20 72 61 6e |essing t|hese ran|
|000006f0| 64 6f 6d 20 61 64 64 72 | 65 73 73 65 73 20 69 6e |dom addr|esses in|
|00000700| 20 79 6f 75 72 20 63 6f | 64 65 20 77 69 6c 6c 20 | your co|de will |
|00000710| 0a 70 72 6f 62 61 62 6c | 79 20 63 61 75 73 65 20 |.probabl|y cause |
|00000720| 73 6f 6d 65 20 73 74 72 | 61 6e 67 65 20 62 65 68 |some str|ange beh|
|00000730| 61 76 69 6f 72 2e 0a 0a | 49 20 70 75 74 20 69 6e |avior...|I put in|
|00000740| 20 61 20 71 75 69 63 6b | 20 66 69 78 20 6a 75 73 | a quick| fix jus|
|00000750| 74 20 66 6f 72 20 64 65 | 6d 6f 6e 73 74 72 61 74 |t for de|monstrat|
|00000760| 69 6f 6e 20 70 75 72 70 | 6f 73 65 73 3a 0a 0a 66 |ion purp|oses:..f|
|00000770| 6f 72 20 28 69 3d 30 3b | 20 69 3c 31 30 30 3b 20 |or (i=0;| i<100; |
|00000780| 69 2b 2b 29 20 77 6f 72 | 64 73 5b 69 5d 20 3d 20 |i++) wor|ds[i] = |
|00000790| 6d 61 6c 6c 6f 63 28 38 | 30 29 3b 20 2f 2a 20 6b |malloc(8|0); /* k|
|000007a0| 6c 75 64 67 79 20 70 61 | 74 63 68 20 74 6f 0a 20 |ludgy pa|tch to. |
|000007b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000007c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000007d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 74 | | t|
|000007e0| 6f 20 74 68 65 20 27 77 | 6f 72 64 27 20 70 72 6f |o the 'w|ord' pro|
|000007f0| 62 6c 65 6d 20 2a 2f 0a | 20 20 20 20 20 20 20 20 |blem */.| |
|00000800| 20 5f 5f 5f 5f 5f 5f 5f | 5f 5f 0a 0a 59 6f 75 20 | _______|__..You |
|00000810| 6e 65 67 6c 65 63 74 65 | 64 20 74 6f 20 63 68 65 |neglecte|d to che|
|00000820| 63 6b 20 66 6f 72 20 74 | 68 65 20 73 69 74 75 61 |ck for t|he situa|
|00000830| 74 69 6f 6e 20 77 68 65 | 72 65 20 74 68 65 20 75 |tion whe|re the u|
|00000840| 73 65 72 20 64 6f 65 73 | 6e 27 74 0a 65 6e 74 65 |ser does|n't.ente|
|00000850| 72 20 61 6e 79 20 70 61 | 72 61 6d 65 74 65 72 73 |r any pa|rameters|
|00000860| 3a 0a 0a 3e 69 66 28 2a | 61 72 67 76 5b 31 5d 20 |:..>if(*|argv[1] |
|00000870| 3d 3d 20 27 2d 27 29 20 | 7b 0a 0a 49 66 20 61 72 |== '-') |{..If ar|
|00000880| 67 63 20 69 73 20 31 2c | 20 74 68 65 6e 20 74 68 |gc is 1,| then th|
|00000890| 65 20 76 61 6c 75 65 20 | 6f 66 20 2a 61 72 67 76 |e value |of *argv|
|000008a0| 5b 31 5d 20 69 73 20 75 | 6e 64 65 66 69 6e 65 64 |[1] is u|ndefined|
|000008b0| 3a 20 6d 6f 72 65 20 73 | 74 72 61 6e 67 65 0a 62 |: more s|trange.b|
|000008c0| 65 68 61 76 69 6f 72 20 | 70 6f 73 73 69 62 6c 65 |ehavior |possible|
|000008d0| 2e 0a 0a 49 20 63 68 61 | 6e 67 65 64 20 74 68 69 |...I cha|nged thi|
|000008e0| 73 20 74 6f 0a 0a 69 66 | 28 61 72 67 63 20 3e 20 |s to..if|(argc > |
|000008f0| 31 20 26 26 20 2a 61 72 | 67 76 5b 31 5d 20 3d 3d |1 && *ar|gv[1] ==|
|00000900| 20 27 2d 27 29 20 7b 20 | 2f 2a 20 64 6f 6e 27 74 | '-') { |/* don't|
|00000910| 20 66 6f 72 67 65 74 20 | 74 6f 20 63 68 65 63 6b | forget |to check|
|00000920| 20 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | . | |
|00000930| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000940| 20 20 20 20 20 20 20 66 | 6f 72 20 6e 6f 20 61 72 | f|or no ar|
|00000950| 67 75 6d 65 6e 74 73 20 | 2a 2f 0a 0a 20 20 20 20 |guments |*/.. |
|00000960| 20 20 20 20 20 5f 5f 5f | 5f 5f 5f 5f 5f 5f 0a 0a | ___|______..|
|00000970| 59 6f 75 20 63 68 65 63 | 6b 20 74 6f 20 6d 61 6b |You chec|k to mak|
|00000980| 65 20 73 75 72 65 20 74 | 68 61 74 20 74 68 65 20 |e sure t|hat the |
|00000990| 66 69 6c 65 20 6f 70 65 | 6e 65 64 2c 20 62 75 74 |file ope|ned, but|
|000009a0| 20 64 6f 6e 27 74 20 68 | 61 6e 64 6c 65 20 74 68 | don't h|andle th|
|000009b0| 65 0a 63 61 73 65 20 77 | 68 65 72 65 20 69 73 20 |e.case w|here is |
|000009c0| 64 69 64 20 6e 6f 74 20 | 6f 70 65 6e 3a 0a 0a 3e |did not |open:..>|
|000009d0| 20 20 20 20 69 66 28 66 | 70 20 3d 3d 20 4e 55 4c | if(f|p == NUL|
|000009e0| 4c 29 20 70 72 69 6e 74 | 66 28 22 43 61 6e 27 74 |L) print|f("Can't|
|000009f0| 20 6f 70 65 6e 20 25 73 | 20 5c 6e 22 2c 66 69 6c | open %s| \n",fil|
|00000a00| 65 6e 61 6d 65 29 3b 0a | 0a 49 20 63 68 61 6e 67 |ename);.|.I chang|
|00000a10| 65 64 20 74 68 69 73 20 | 74 6f 0a 0a 20 20 20 20 |ed this |to.. |
|00000a20| 69 66 28 66 70 20 3d 3d | 20 4e 55 4c 4c 29 20 0a |if(fp ==| NULL) .|
|00000a30| 20 20 20 20 20 20 20 20 | 7b 0a 20 20 20 20 20 20 | |{. |
|00000a40| 20 20 70 72 69 6e 74 66 | 28 22 43 61 6e 27 74 20 | printf|("Can't |
|00000a50| 6f 70 65 6e 20 25 73 20 | 5c 6e 22 2c 66 69 6c 65 |open %s |\n",file|
|00000a60| 6e 61 6d 65 29 3b 0a 20 | 20 20 20 20 20 20 20 65 |name);. | e|
|00000a70| 78 69 74 28 30 29 3b 0a | 20 20 20 20 20 20 20 20 |xit(0);.| |
|00000a80| 7d 0a 0a 20 20 20 20 20 | 20 20 20 20 5f 5f 5f 5f |}.. | ____|
|00000a90| 5f 5f 5f 5f 5f 0a 0a 54 | 68 65 20 66 6f 6c 6c 6f |_____..T|he follo|
|00000aa0| 77 69 6e 67 20 64 6f 65 | 73 20 6e 6f 74 20 72 65 |wing doe|s not re|
|00000ab0| 61 63 68 20 74 68 65 20 | 6c 61 73 74 20 63 6f 6d |ach the |last com|
|00000ac0| 6d 61 6e 64 2d 6c 69 6e | 65 20 70 61 72 61 6d 65 |mand-lin|e parame|
|00000ad0| 74 65 72 3a 0a 0a 3e 20 | 20 20 20 20 20 20 20 20 |ter:..> | |
|00000ae0| 20 66 6f 72 28 69 3d 33 | 3b 69 3c 3d 61 72 67 63 | for(i=3|;i<=argc|
|00000af0| 3b 69 2b 2b 29 20 7b 0a | 0a 53 6f 2c 20 49 20 63 |;i++) {.|.So, I c|
|00000b00| 68 61 6e 67 65 64 20 69 | 74 20 74 6f 0a 0a 20 20 |hanged i|t to.. |
|00000b10| 20 20 20 20 20 20 20 20 | 66 6f 72 28 69 3d 33 3b | |for(i=3;|
|00000b20| 69 3c 61 72 67 63 3b 69 | 2b 2b 29 20 7b 20 2f 2a |i<argc;i|++) { /*|
|00000b30| 20 69 3c 61 72 67 63 2c | 20 6e 6f 74 20 69 3c 3d | i<argc,| not i<=|
|00000b40| 61 72 67 63 20 2a 2f 0a | 0a 20 20 20 20 20 20 20 |argc */.|. |
|00000b50| 20 20 5f 5f 5f 5f 5f 5f | 5f 5f 5f 0a 0a 42 65 63 | ______|___..Bec|
|00000b60| 61 75 73 65 20 6f 66 20 | 74 68 65 20 77 61 79 20 |ause of |the way |
|00000b70| 79 6f 75 20 68 61 76 65 | 20 61 73 73 69 67 6e 65 |you have| assigne|
|00000b80| 64 20 6e 75 6d 77 6f 72 | 64 73 2c 20 74 68 65 20 |d numwor|ds, the |
|00000b90| 66 6f 6c 6c 6f 77 69 6e | 67 3a 0a 0a 3e 20 20 20 |followin|g:..> |
|00000ba0| 66 6f 72 28 69 3d 30 3b | 69 3c 20 6e 75 6d 77 6f |for(i=0;|i< numwo|
|00000bb0| 72 64 73 3b 69 2b 2b 29 | 20 7b 0a 0a 73 68 6f 75 |rds;i++)| {..shou|
|00000bc0| 6c 64 20 62 65 0a 0a 20 | 20 20 66 6f 72 28 69 3d |ld be.. | for(i=|
|00000bd0| 30 3b 69 3c 3d 20 6e 75 | 6d 77 6f 72 64 73 3b 69 |0;i<= nu|mwords;i|
|00000be0| 2b 2b 29 20 7b 20 2f 2a | 20 74 68 65 20 77 61 79 |++) { /*| the way|
|00000bf0| 20 6e 75 6d 77 6f 72 64 | 73 20 69 73 20 73 65 74 | numword|s is set|
|00000c00| 2c 20 69 74 20 73 68 6f | 75 6c 64 20 62 65 0a 20 |, it sho|uld be. |
|00000c10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000c20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 69 20 | | i |
|00000c30| 3c 3d 20 6e 75 6d 77 6f | 72 64 73 2c 20 69 6e 73 |<= numwo|rds, ins|
|00000c40| 74 65 61 64 20 6f 66 20 | 69 20 3c 20 6e 75 6d 77 |tead of |i < numw|
|00000c50| 6f 72 64 73 20 2a 2f 0a | 0a 20 20 20 20 20 20 20 |ords */.|. |
|00000c60| 20 20 5f 5f 5f 5f 5f 5f | 5f 5f 5f 0a 0a 54 68 65 | ______|___..The|
|00000c70| 20 63 6f 6d 70 6c 65 74 | 65 64 20 72 65 76 69 73 | complet|ed revis|
|00000c80| 69 6f 6e 20 74 68 65 6e | 20 6c 6f 6f 6b 73 20 6c |ion then| looks l|
|00000c90| 69 6b 65 20 74 68 69 73 | 3a 0a 0a 20 0a 23 69 6e |ike this|:.. .#in|
|00000ca0| 63 6c 75 64 65 20 3c 73 | 74 64 69 6f 2e 68 3e 20 |clude <s|tdio.h> |
|00000cb0| 20 2f 2a 20 46 49 4c 45 | 20 64 65 63 6c 61 72 65 | /* FILE| declare|
|00000cc0| 64 20 68 65 72 65 20 2a | 2f 0a 23 69 6e 63 6c 75 |d here *|/.#inclu|
|00000cd0| 64 65 20 3c 73 74 72 69 | 6e 67 2e 68 3e 0a 23 69 |de <stri|ng.h>.#i|
|00000ce0| 6e 63 6c 75 64 65 20 3c | 73 74 64 6c 69 62 2e 68 |nclude <|stdlib.h|
|00000cf0| 3e 20 2f 2a 20 65 78 69 | 74 20 61 6e 64 20 6d 61 |> /* exi|t and ma|
|00000d00| 6c 6c 6f 63 20 64 65 63 | 6c 61 72 65 64 20 68 65 |lloc dec|lared he|
|00000d10| 72 65 20 2a 2f 0a 0a 6d | 61 69 6e 28 69 6e 74 20 |re */..m|ain(int |
|00000d20| 61 72 67 63 2c 20 63 68 | 61 72 20 2a 61 72 67 76 |argc, ch|ar *argv|
|00000d30| 5b 5d 29 0a 7b 0a 63 68 | 61 72 20 66 69 72 73 74 |[]).{.ch|ar first|
|00000d40| 5b 31 30 30 5d 2c 20 6c | 65 74 74 2c 20 2a 77 6f |[100], l|ett, *wo|
|00000d50| 72 64 73 5b 31 30 30 5d | 2c 20 66 69 6c 65 6e 61 |rds[100]|, filena|
|00000d60| 6d 65 5b 31 35 5d 3b 20 | 0a 69 6e 74 20 6e 75 6d |me[15]; |.int num|
|00000d70| 77 6f 72 64 73 2c 20 63 | 6f 6e 74 3d 31 3b 0a 69 |words, c|ont=1;.i|
|00000d80| 6e 74 20 69 2c 20 6a 2c | 20 72 65 70 65 61 74 3d |nt i, j,| repeat=|
|00000d90| 31 30 2c 20 72 2c 6b 3d | 30 2c 74 3b 0a 69 6e 74 |10, r,k=|0,t;.int|
|00000da0| 20 6e 72 65 6d 3b 0a 46 | 49 4c 45 2a 20 66 70 3b | nrem;.F|ILE* fp;|
|00000db0| 0a 0a 66 6f 72 20 28 69 | 3d 30 3b 20 69 3c 31 30 |..for (i|=0; i<10|
|00000dc0| 30 3b 20 69 2b 2b 29 20 | 77 6f 72 64 73 5b 69 5d |0; i++) |words[i]|
|00000dd0| 20 3d 20 6d 61 6c 6c 6f | 63 28 38 30 29 3b 20 2f | = mallo|c(80); /|
|00000de0| 2a 20 6b 6c 75 64 67 79 | 20 70 61 74 63 68 20 74 |* kludgy| patch t|
|00000df0| 6f 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |o. | |
|00000e00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000e20| 20 20 74 6f 20 74 68 65 | 20 27 77 6f 72 64 27 20 | to the| 'word' |
|00000e30| 70 72 6f 62 6c 65 6d 20 | 2a 2f 0a 0a 69 66 28 61 |problem |*/..if(a|
|00000e40| 72 67 63 20 3e 20 31 20 | 26 26 20 2a 61 72 67 76 |rgc > 1 |&& *argv|
|00000e50| 5b 31 5d 20 3d 3d 20 27 | 2d 27 29 20 7b 20 2f 2a |[1] == '|-') { /*|
|00000e60| 20 64 6f 6e 27 74 20 66 | 6f 72 67 65 74 20 74 6f | don't f|orget to|
|00000e70| 20 63 68 65 63 6b 20 0a | 20 20 20 20 20 20 20 20 | check .| |
|00000e80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000e90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 66 6f 72 | | for|
|00000ea0| 20 6e 6f 20 61 72 67 75 | 6d 65 6e 74 73 20 2a 2f | no argu|ments */|
|00000eb0| 0a 20 20 20 20 73 74 72 | 63 70 79 28 66 69 6c 65 |. str|cpy(file|
|00000ec0| 6e 61 6d 65 2c 20 61 72 | 67 76 5b 32 5d 29 3b 0a |name, ar|gv[2]);.|
|00000ed0| 20 20 20 20 66 70 3d 20 | 66 6f 70 65 6e 28 66 69 | fp= |fopen(fi|
|00000ee0| 6c 65 6e 61 6d 65 2c 22 | 72 22 29 3b 0a 20 20 20 |lename,"|r");. |
|00000ef0| 20 69 66 28 66 70 20 3d | 3d 20 4e 55 4c 4c 29 20 | if(fp =|= NULL) |
|00000f00| 0a 20 20 20 20 20 20 20 | 20 7b 0a 20 20 20 20 20 |. | {. |
|00000f10| 20 20 20 70 72 69 6e 74 | 66 28 22 43 61 6e 27 74 | print|f("Can't|
|00000f20| 20 6f 70 65 6e 20 25 73 | 20 5c 6e 22 2c 66 69 6c | open %s| \n",fil|
|00000f30| 65 6e 61 6d 65 29 3b 0a | 20 20 20 20 20 20 20 20 |ename);.| |
|00000f40| 65 78 69 74 28 30 29 3b | 0a 20 20 20 20 20 20 20 |exit(0);|. |
|00000f50| 20 7d 0a 20 20 20 20 6b | 3d 30 3b 2a 77 6f 72 64 | }. k|=0;*word|
|00000f60| 73 5b 31 5d 3d 27 31 27 | 3b 0a 20 20 20 20 77 68 |s[1]='1'|;. wh|
|00000f70| 69 6c 65 28 66 73 63 61 | 6e 66 28 66 70 2c 20 22 |ile(fsca|nf(fp, "|
|00000f80| 25 73 22 2c 20 77 6f 72 | 64 73 5b 6b 5d 29 20 21 |%s", wor|ds[k]) !|
|00000f90| 3d 20 45 4f 46 20 29 20 | 7b 0a 20 20 20 20 6b 2b |= EOF ) |{. k+|
|00000fa0| 2b 3b 0a 20 20 20 20 7d | 0a 20 20 20 20 66 63 6c |+;. }|. fcl|
|00000fb0| 6f 73 65 28 66 70 29 3b | 0a 20 20 20 20 6e 75 6d |ose(fp);|. num|
|00000fc0| 77 6f 72 64 73 3d 6b 2d | 31 3b 20 20 20 20 20 20 |words=k-|1; |
|00000fd0| 20 20 20 20 0a 20 20 20 | 20 69 66 28 61 72 67 63 | . | if(argc|
|00000fe0| 3e 32 29 20 7b 0a 20 20 | 20 20 20 20 20 20 20 20 |>2) {. | |
|00000ff0| 66 6f 72 28 69 3d 33 3b | 69 3c 61 72 67 63 3b 69 |for(i=3;|i<argc;i|
|00001000| 2b 2b 29 20 7b 20 2f 2a | 20 69 3c 61 72 67 63 2c |++) { /*| i<argc,|
|00001010| 20 6e 6f 74 20 69 3c 3d | 61 72 67 63 20 2a 2f 0a | not i<=|argc */.|
|00001020| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 73 74 72 | | str|
|00001030| 63 70 79 28 77 6f 72 64 | 73 5b 6b 5d 2c 61 72 67 |cpy(word|s[k],arg|
|00001040| 76 5b 69 5d 29 3b 0a 20 | 20 20 20 20 20 20 20 20 |v[i]);. | |
|00001050| 20 20 20 20 6b 2b 2b 3b | 0a 20 20 20 20 20 20 20 | k++;|. |
|00001060| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|00001070| 20 20 7d 0a 20 20 20 20 | 6e 75 6d 77 6f 72 64 73 | }. |numwords|
|00001080| 3d 6b 2d 31 3b 0a 20 20 | 20 7d 0a 65 6c 73 65 0a |=k-1;. | }.else.|
|00001090| 20 20 20 7b 0a 20 20 20 | 6e 75 6d 77 6f 72 64 73 | {. |numwords|
|000010a0| 3d 61 72 67 63 2d 31 3b | 0a 20 20 20 20 66 6f 72 |=argc-1;|. for|
|000010b0| 28 6b 3d 30 3b 6b 3c 6e | 75 6d 77 6f 72 64 73 3b |(k=0;k<n|umwords;|
|000010c0| 6b 2b 2b 29 0a 20 20 20 | 20 20 20 20 20 20 20 73 |k++). | s|
|000010d0| 74 72 63 70 79 28 77 6f | 72 64 73 5b 6b 5d 2c 61 |trcpy(wo|rds[k],a|
|000010e0| 72 67 76 5b 6b 2b 31 5d | 29 3b 0a 20 20 20 7d 0a |rgv[k+1]|);. }.|
|000010f0| 0a 20 20 20 6e 72 65 6d | 3d 31 3b 0a 20 20 20 66 |. nrem|=1;. f|
|00001100| 6f 72 28 69 3d 30 3b 69 | 3c 3d 20 6e 75 6d 77 6f |or(i=0;i|<= numwo|
|00001110| 72 64 73 3b 69 2b 2b 29 | 20 7b 20 2f 2a 20 74 68 |rds;i++)| { /* th|
|00001120| 65 20 77 61 79 20 6e 75 | 6d 77 6f 72 64 73 20 69 |e way nu|mwords i|
|00001130| 73 20 73 65 74 2c 20 69 | 74 20 73 68 6f 75 6c 64 |s set, i|t should|
|00001140| 20 62 65 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | be. | |
|00001150| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001160| 20 20 20 69 20 3c 3d 20 | 6e 75 6d 77 6f 72 64 73 | i <= |numwords|
|00001170| 2c 20 69 6e 73 74 65 61 | 64 20 6f 66 20 69 20 3c |, instea|d of i <|
|00001180| 20 6e 75 6d 77 6f 72 64 | 73 20 2a 2f 0a 20 20 20 | numword|s */. |
|00001190| 20 20 70 72 69 6e 74 66 | 28 22 25 33 64 2e 20 25 | printf|("%3d. %|
|000011a0| 31 30 73 22 2c 20 69 2b | 31 2c 20 77 6f 72 64 73 |10s", i+|1, words|
|000011b0| 5b 69 5d 29 3b 0a 20 20 | 20 20 20 6e 72 65 6d 3d |[i]);. | nrem=|
|000011c0| 28 69 25 34 29 3b 0a 20 | 20 20 20 20 69 66 28 69 |(i%4);. | if(i|
|000011d0| 3e 33 20 26 26 20 21 6e | 72 65 6d 29 20 70 72 69 |>3 && !n|rem) pri|
|000011e0| 6e 74 66 28 22 5c 6e 22 | 29 3b 0a 20 20 20 20 20 |ntf("\n"|);. |
|000011f0| 7d 0a 7d 0a 0a 0a 48 6f | 70 65 20 74 68 69 73 20 |}.}...Ho|pe this |
|00001200| 68 65 6c 70 73 2e 0a 4b | 65 76 69 6e 20 49 6e 67 |helps..K|evin Ing|
|00001210| 61 6c 6c 73 2c 20 28 32 | 30 36 29 37 37 33 2d 39 |alls, (2|06)773-9|
|00001220| 34 30 34 2c 20 69 6e 67 | 6b 6c 39 30 30 40 63 63 |404, ing|kl900@cc|
|00001230| 6d 61 69 6c 2e 63 61 2e | 62 6f 65 69 6e 67 2e 63 |mail.ca.|boeing.c|
|00001240| 6f 6d 0a 0a 0a | |om... | |
+--------+-------------------------+-------------------------+--------+--------+